﻿using Geek.Server.Core.Net.Tcp.Handler;

namespace Server.Logic.Common.Handler
{
    public static class MessageHandlerExtensions
    {
        public static void SetResponse(this BaseMessageHandler channel, MessageErrorCode code)
        {
            var request = channel.Msg as RequestMessage;
            if (request == null)
                return;

            channel.Channel.Write(new CommonResp
            {
                ErrorCode = (int)code,
            });
        }
    }
}